//
//  OBTabBarController.m
//  XZXSchool
//
//  Created by obally on 2017/10/23.
//  Copyright © 2017年 obally. All rights reserved.
//

#import "OBTabBarController.h"
#import "OBTabBar.h"
@interface OBTabBarController ()
@property (nonatomic, strong, readwrite) UITabBarController *tabBarController;
@end

@implementation OBTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController = [[UITabBarController alloc]init];
    [self.view addSubview:self.tabBarController.view];
    [self addChildViewController:self.tabBarController];
    [self.tabBarController didMoveToParentViewController:self];
    // kvc替换系统的tabBar
    OBTabBar *tabBar = [[OBTabBar alloc]init];
    [self.tabBarController setValue:tabBar forKey:@"tabBar"];
    
}
#pragma mark - Ovveride
- (BOOL)shouldAutorotate {
    return self.tabBarController.selectedViewController.shouldAutorotate;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return self.tabBarController.selectedViewController.supportedInterfaceOrientations;
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return self.tabBarController.selectedViewController.preferredStatusBarStyle;
}

- (BOOL)prefersStatusBarHidden{
    return self.tabBarController.selectedViewController.prefersStatusBarHidden;
}
@end
